#include "cppvi.h"

CppVi *CppVi::instance = 0;

CppVi::CppVi(): console(new Console()), document(new Document())
{
	this->console->bindDocument(this->document);
}

CppVi::~CppVi()
{
	delete this->console;
	delete this->document;
}

void CppVi::start(int argc, char *argv[])
{
	Argument *arg = new Argument(argc, argv);
	this->console->start(arg);
}
Document *CppVi::getDocument()
{
	return this->document;
}

CppVi *CppVi::getInstance()
{
	if (CppVi::instance == 0)
		CppVi::instance = new CppVi();
	return CppVi::instance;
}
